import cv2
camera_Coordinate= []
robot_Coordinate = []

def calibrate():
    ## 获取相机的9个点坐标
    camera_Coordinate= []
    ## 获取机器人的9个点坐标
    robot_Coordinate = []
    matrix, _ = cv2.estimateAffine2D(camera_Coordinate, robot_Coordinate)
    return matrix

def get_points_robot(x_camera, y_camera):
    """
    相机坐标通过仿射矩阵变换取得机器坐标
    :param x_camera:
    :param y_camera:
    :return:
    """
    matrix = calibrate(camera_Coordinate, robot_Coordinate)
    robot_x = (matrix[0][0] * x_camera) + (matrix[0][1] * y_camera) + matrix[0][2]
    robot_y = (matrix[1][0] * x_camera) + (matrix[1][1] * y_camera) + matrix[1][2]

# robot_x = (A * x_camera) + (B * y_camera) + C
# robot_y = (D * x_camera) + (E * y_camera) + F
